import 'package:base_flutter/base_flutter.dart';
import 'package:ls_work/net/api/http_api.dart';
import 'package:ls_work/net/post_request.dart';

class PrinterModel extends BaseMvvmModel{
  @override
  void onCleared() {
  }

  Future<bool> bindPrinter(String snCode) async {
    var map = {
      "sn":snCode
    };
    var data = await HttpGo.instance.postData(BookFoodApis.bindPrinter,data: map.toJsonMapStr(),options: PostRequest.urlencodedHeader);
    if('0'==data['code']){
      return true;
    }else{
      throw data['msg'];
    }
  }
}